from bs4 import BeautifulSoup								#导入库
soup = BeautifulSoup(open('index.html'),'lxml')					#创建对象
print(soup.head.contents)									#输出子节点
print(soup.head.contents[0])								#获取第一个元素
